package com.share.pattern.observer.v4;

import java.util.Scanner;

/**
 * 
 * @author Johnny Tam 
 * 
 * 观察者模式
 * 抽象
 * 
 */
public class ObserverDemoV04 {

	public static void main(String[] args) {
		
		ConcreteSubject mSubject = new ConcreteSubject();
		
		mSubject.Attach(new ConcreteObserver("X", mSubject));
		mSubject.Attach(new ConcreteObserver("Y", mSubject));
		mSubject.Attach(new ConcreteObserver("Z", mSubject));
		
		mSubject.setState("ABC");
		
		mSubject.Notify();
			
	}

}
